import request from '@/utils/request'

export function fetchList(query) {
    return request({
        url: 'https://localhost:44398/api/app/shop-type',//'/api/app/book',
        method: 'get',
        params: query
    })
}

export function fetchArticle(id) {
    return request({
        url: 'https://localhost:44398/api/app/shop-type',
        method: 'get',
        params: { id }
    })
}

export function fetchPv(pv) {
    return request({
      url: 'https://localhost:44398/api/app/shop-type',
      method: 'get',
      params: { pv }
    })
  }

export function createArticle(data) {
    return request({
        url: 'https://localhost:44398/api/app/shop-type',
        method: 'post',
        data
    })
}

export function updateArticle(data) {
    return request({
        url: 'https://localhost:44398/api/app/shop-type/' + data.id,
        method: 'put',
        data
    })
}

export function deleteArticle(data) {
    return request({
        url: 'https://localhost:44398/api/app/shop-type/' + data.id,
        method: 'delete',
        data
    })
}